home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / AppleTalk.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  26.4 KB  |  791 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleTalk.p
  3.  
  4.      Contains:    AppleTalk Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT AppleTalk;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __APPLETALK__}
  30. {$SETC __APPLETALK__ := 1}
  31.  
  32. {$I+}
  33. {$SETC AppleTalkIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __OSUTILS__}
  43. {$I OSUtils.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    Memory.p                                                    }
  47.  
  48. {$PUSH}
  49. {$ALIGN MAC68K}
  50. {$LibExport+}
  51.  
  52. CONST
  53. { Driver unit and reference numbers (ADSP is dynamic) }
  54.     mppUnitNum                    = 9;                            { MPP unit number }
  55.     atpUnitNum                    = 10;                            { ATP unit number }
  56.     xppUnitNum                    = 40;                            { XPP unit number }
  57.     mppRefNum                    = -10;                            { MPP reference number }
  58.     atpRefNum                    = -11;                            { ATP reference number }
  59.     xppRefNum                    = -41;                            { XPP reference number }
  60. { .MPP csCodes }
  61.     lookupReply                    = 242;                            { This command queued to ourself }
  62.     writeLAP                    = 243;                            { Write out LAP packet }
  63.     detachPH                    = 244;                            { Detach LAP protocol handler }
  64.     attachPH                    = 245;                            { Attach LAP protocol handler }
  65.     writeDDP                    = 246;                            { Write out DDP packet }
  66.     closeSkt                    = 247;                            { Close DDP socket }
  67.     openSkt                        = 248;                            { Open DDP socket }
  68.     loadNBP                        = 249;                            { Load NBP command-executing code }
  69.     lastResident                = 249;                            { Last resident command }
  70.     confirmName                    = 250;                            { Confirm name }
  71.     lookupName                    = 251;                            { Look up name on internet }
  72.     removeName                    = 252;                            { Remove name from Names Table }
  73.     registerName                = 253;                            { Register name in Names Table }
  74.     killNBP                        = 254;                            { Kill outstanding NBP request }
  75.  
  76.     unloadNBP                    = 255;                            { Unload NBP command code }
  77.     setSelfSend                    = 256;                            { MPP: Set to allow writes to self }
  78.     SetMyZone                    = 257;                            { Set my zone name }
  79.     GetATalkInfo                = 258;                            { get AppleTalk information }
  80.     ATalkClosePrep                = 259;                            { AppleTalk close query }
  81. { .ATP csCodes }
  82.     nSendRequest                = 248;                            { NSendRequest code }
  83.     relRspCB                    = 249;                            { Release RspCB }
  84.     closeATPSkt                    = 250;                            { Close ATP socket }
  85.     addResponse                    = 251;                            { Add response code | Require open skt }
  86.     sendResponse                = 252;                            { Send response code }
  87.     getRequest                    = 253;                            { Get request code }
  88.     openATPSkt                    = 254;                            { Open ATP socket }
  89.     sendRequest                    = 255;                            { Send request code }
  90.     relTCB                        = 256;                            { Release TCB }
  91.     killGetReq                    = 257;                            { Kill GetRequest }
  92.     killSendReq                    = 258;                            { Kill SendRequest }
  93.     killAllGetReq                = 259;                            { Kill all getRequests for a skt }
  94. { .XPP csCodes }
  95.     openSess                    = 255;                            { Open session }
  96.     closeSess                    = 254;                            { Close session }
  97.     userCommand                    = 253;                            { User command }
  98.  
  99.     userWrite                    = 252;                            { User write }
  100.     getStatus                    = 251;                            { Get status }
  101.     afpCall                        = 250;                            { AFP command (buffer has command code) }
  102.     getParms                    = 249;                            { Get parameters }
  103.     abortOS                        = 248;                            { Abort open session request }
  104.     closeAll                    = 247;                            { Close all open sessions }
  105.     xCall                        = 246;                            { .XPP extended calls }
  106. { Transition Queue transition types }
  107.     ATTransOpen                    = 0;                            {AppleTalk has opened}
  108.     ATTransClose                = 2;                            {AppleTalk is about to close}
  109.     ATTransClosePrep            = 3;                            {Is it OK to close AppleTalk ?}
  110.     ATTransCancelClose            = 4;                            {Cancel the ClosePrep transition}
  111.     afpByteRangeLock            = 1;                            {AFPCall command codes}
  112.     afpVolClose                    = 2;                            {AFPCall command codes}
  113.     afpDirClose                    = 3;                            {AFPCall command codes}
  114.     afpForkClose                = 4;                            {AFPCall command codes}
  115.     afpCopyFile                    = 5;                            {AFPCall command codes}
  116.     afpDirCreate                = 6;                            {AFPCall command codes}
  117.     afpFileCreate                = 7;                            {AFPCall command codes}
  118.     afpDelete                    = 8;                            {AFPCall command codes}
  119.     afpEnumerate                = 9;                            {AFPCall command codes}
  120.  
  121.     afpFlush                    = 10;                            {AFPCall command codes}
  122.     afpForkFlush                = 11;                            {AFPCall command codes}
  123.     afpGetDirParms                = 12;                            {AFPCall command codes}
  124.     afpGetFileParms                = 13;                            {AFPCall command codes}
  125.     afpGetForkParms                = 14;                            {AFPCall command codes}
  126.     afpGetSInfo                    = 15;                            {AFPCall command codes}
  127.     afpGetSParms                = 16;                            {AFPCall command codes}
  128.     afpGetVolParms                = 17;                            {AFPCall command codes}
  129.     afpLogin                    = 18;                            {AFPCall command codes}
  130.     afpContLogin                = 19;                            {AFPCall command codes}
  131.     afpLogout                    = 20;                            {AFPCall command codes}
  132.     afpMapID                    = 21;                            {AFPCall command codes}
  133.     afpMapName                    = 22;                            {AFPCall command codes}
  134.     afpMove                        = 23;                            {AFPCall command codes}
  135.     afpOpenVol                    = 24;                            {AFPCall command codes}
  136.     afpOpenDir                    = 25;                            {AFPCall command codes}
  137.     afpOpenFork                    = 26;                            {AFPCall command codes}
  138.     afpRead                        = 27;                            {AFPCall command codes}
  139.     afpRename                    = 28;                            {AFPCall command codes}
  140.     afpSetDirParms                = 29;                            {AFPCall command codes}
  141.  
  142.     afpSetFileParms                = 30;                            {AFPCall command codes}
  143.     afpSetForkParms                = 31;                            {AFPCall command codes}
  144.     afpSetVolParms                = 32;                            {AFPCall command codes}
  145.     afpWrite                    = 33;                            {AFPCall command codes}
  146.     afpGetFlDrParms                = 34;                            {AFPCall command codes}
  147.     afpSetFlDrParms                = 35;                            {AFPCall command codes}
  148.     afpDTOpen                    = 48;                            {AFPCall command codes}
  149.     afpDTClose                    = 49;                            {AFPCall command codes}
  150.     afpGetIcon                    = 51;                            {AFPCall command codes}
  151.     afpGtIcnInfo                = 52;                            {AFPCall command codes}
  152.     afpAddAPPL                    = 53;                            {AFPCall command codes}
  153.     afpRmvAPPL                    = 54;                            {AFPCall command codes}
  154.     afpGetAPPL                    = 55;                            {AFPCall command codes}
  155.     afpAddCmt                    = 56;                            {AFPCall command codes}
  156.     afpRmvCmt                    = 57;                            {AFPCall command codes}
  157.     afpGetCmt                    = 58;                            {AFPCall command codes}
  158.     afpAddIcon                    = 192;                            {Special code for ASP Write commands}
  159.     xppLoadedBit                = 5;                            { XPP bit in PortBUse }
  160.     scbMemSize                    = 192;                            { Size of memory for SCB }
  161.     xppFlagClr                    = 0;                            { Cs for AFPCommandBlock }
  162.  
  163.     xppFlagSet                    = 128;                            { StartEndFlag & NewLineFlag fields. }
  164.     lapSize                        = 20;
  165.     ddpSize                        = 26;
  166.     nbpSize                        = 26;
  167.     atpSize                        = 56;
  168.     atpXOvalue                    = 32;                            {ATP exactly-once bit }
  169.     atpEOMvalue                    = 16;                            {ATP End-Of-Message bit }
  170.     atpSTSvalue                    = 8;                            {ATP Send-Transmission-Status bit }
  171.     atpTIDValidvalue            = 2;                            {ATP trans. ID valid bit }
  172.     atpSendChkvalue                = 1;                            {ATP send checksum bit }
  173.     zipGetLocalZones            = 5;
  174.     zipGetZoneList                = 6;
  175.     zipGetMyZone                = 7;
  176.     LAPMgrPtr                    = $B18;                            {Entry point for LAP Manager}
  177.     LAPMgrCall                    = 2;                            {Offset to LAP routines}
  178.     LAddAEQ                        = 23;                            {LAPAddATQ routine selector}
  179.     LRmvAEQ                        = 24;                            {LAPRmvATQ routine selector}
  180.  
  181.     tLAPRead                    = 0;
  182.     tLAPWrite                    = 1;
  183.     tDDPRead                    = 2;
  184.     tDDPWrite                    = 3;
  185.     tNBPLookup                    = 4;
  186.     tNBPConfirm                    = 5;
  187.     tNBPRegister                = 6;
  188.     tATPSndRequest                = 7;
  189.     tATPGetRequest                = 8;
  190.     tATPSdRsp                    = 9;
  191.     tATPAddRsp                    = 10;
  192.     tATPRequest                    = 11;
  193.     tATPResponse                = 12;
  194.  
  195.     
  196. TYPE
  197.     ABCallType = SInt8;
  198.  
  199.  
  200. CONST
  201.     lapProto                    = 0;
  202.     ddpProto                    = 1;
  203.     nbpProto                    = 2;
  204.     atpProto                    = 3;
  205.  
  206.     
  207. TYPE
  208.     ABProtoType = UInt8;
  209.  
  210.     ABByte = Byte;
  211.  
  212.     LAPAdrBlock = PACKED RECORD
  213.         dstNodeID:                UInt8;
  214.         srcNodeID:                UInt8;
  215.         lapProtType:            ABByte;
  216.         filler:                    UInt8;                                    {    Filler for proper byte alignment}
  217.     END;
  218.  
  219.     ATQEntryPtr = ^ATQEntry;
  220.  
  221.     ATalkTransitionEventProcPtr = ProcPtr;  { FUNCTION ATalkTransitionEvent(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT; }
  222.     ATalkTransitionEventUPP = UniversalProcPtr;
  223.  
  224.     ATalkTransitionEvent = ATalkTransitionEventUPP;
  225.  
  226.     ATQEntry = RECORD
  227.         qLink:                    ^ATQEntry;                                {next queue entry}
  228.         qType:                    INTEGER;                                {queue type}
  229.         CallAddr:                ATalkTransitionEventUPP;                {your routine descriptor}
  230.     END;
  231.  
  232.     AddrBlock = PACKED RECORD
  233.         aNet:                    UInt16;
  234.         aNode:                    UInt8;
  235.         aSocket:                UInt8;
  236.     END;
  237.  
  238.     Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  239.     offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  240.     In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  241.     only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  242.     be the same, which is OK since they are not used. 
  243. }
  244.     EntityName = RECORD
  245.         objStr:                    Str32;
  246.         typeStr:                Str32;
  247.         zoneStr:                Str32;
  248.     END;
  249.  
  250.     EntityPtr = ^EntityName;
  251.  
  252.     RetransType = PACKED RECORD
  253.         retransInterval:        UInt8;
  254.         retransCount:            UInt8;
  255.     END;
  256.  
  257.     BDSElement = RECORD
  258.         buffSize:                INTEGER;
  259.         buffPtr:                Ptr;
  260.         dataSize:                INTEGER;
  261.         userBytes:                LONGINT;
  262.     END;
  263.  
  264.     BDSType = ARRAY [0..7] OF BDSElement;
  265.  
  266.     BDSPtr = ^BDSElement;
  267.  
  268.     BitMapType = PACKED ARRAY [0..7] OF BOOLEAN;
  269.  
  270.     ATLAPRec = RECORD
  271.         abOpcode:                ABCallType;
  272.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  273.         abResult:                INTEGER;
  274.         abUserReference:        LONGINT;
  275.         lapAddress:                LAPAdrBlock;
  276.         lapReqCount:            INTEGER;
  277.         lapActCount:            INTEGER;
  278.         lapDataPtr:                Ptr;
  279.     END;
  280.  
  281.     ATLAPRecPtr = ^ATLAPRec;
  282.     ATLAPRecHandle = ^ATLAPRecPtr;
  283.  
  284.     ATDDPRec = RECORD
  285.         abOpcode:                ABCallType;
  286.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  287.         abResult:                INTEGER;
  288.         abUserReference:        LONGINT;
  289.         ddpType:                INTEGER;
  290.         ddpSocket:                INTEGER;
  291.         ddpAddress:                AddrBlock;
  292.         ddpReqCount:            INTEGER;
  293.         ddpActCount:            INTEGER;
  294.         ddpDataPtr:                Ptr;
  295.         ddpNodeID:                INTEGER;
  296.     END;
  297.  
  298.     ATDDPRecPtr = ^ATDDPRec;
  299.     ATDDPRecHandle = ^ATDDPRecPtr;
  300.  
  301.     ATNBPRec = RECORD
  302.         abOpcode:                ABCallType;
  303.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  304.         abResult:                INTEGER;
  305.         abUserReference:        LONGINT;
  306.         nbpEntityPtr:            EntityPtr;
  307.         nbpBufPtr:                Ptr;
  308.         nbpBufSize:                INTEGER;
  309.         nbpDataField:            INTEGER;
  310.         nbpAddress:                AddrBlock;
  311.         nbpRetransmitInfo:        RetransType;
  312.     END;
  313.  
  314.     ATNBPRecPtr = ^ATNBPRec;
  315.     ATNBPRecHandle = ^ATNBPRecPtr;
  316.  
  317.     ATATPRec = RECORD
  318.         abOpcode:                ABCallType;
  319.         filler1:                SInt8;                                    {    Filler for proper byte alignment}
  320.         abResult:                INTEGER;
  321.         abUserReference:        LONGINT;
  322.         atpSocket:                INTEGER;
  323.         atpAddress:                AddrBlock;
  324.         atpReqCount:            INTEGER;
  325.         atpDataPtr:                Ptr;
  326.         atpRspBDSPtr:            BDSPtr;
  327.         atpBitMap:                BitMapType;
  328.         filler2:                SInt8; (* UInt8 *)                        {    Filler for proper byte alignment}
  329.         atpTransID:                INTEGER;
  330.         atpActCount:            INTEGER;
  331.         atpUserData:            LONGINT;
  332.         atpXO:                    BOOLEAN;
  333.         atpEOM:                    BOOLEAN;
  334.         atpTimeOut:                INTEGER;
  335.         atpRetries:                INTEGER;
  336.         atpNumBufs:                INTEGER;
  337.         atpNumRsp:                INTEGER;
  338.         atpBDSSize:                INTEGER;
  339.         atpRspUData:            LONGINT;
  340.         atpRspBuf:                Ptr;
  341.         atpRspSize:                INTEGER;
  342.     END;
  343.  
  344.     ATATPRecPtr = ^ATATPRec;
  345.     ATATPRecHandle = ^ATATPRecPtr;
  346.  
  347.     AFPCommandBlock = PACKED RECORD
  348.         cmdByte:                UInt8;
  349.         startEndFlag:            UInt8;
  350.         forkRefNum:                INTEGER;
  351.         rwOffset:                LONGINT;
  352.         reqCount:                LONGINT;
  353.         newLineFlag:            UInt8;
  354.         newLineChar:            CHAR;
  355.     END;
  356.  
  357.     MPPPBPtr = ^MPPParamBlock;
  358.  
  359.     ATPPBPtr = ^ATPParamBlock;
  360.  
  361.     XPPParmBlkPtr = ^XPPParamBlock;
  362.  
  363.     {
  364.         MPPCompletionProcPtr uses register based parameters on the 68k and cannot
  365.         be written in or called from a high-level language without the help of
  366.         mixed mode or assembly glue.
  367.  
  368.         In:
  369.          => thePBptr        A0.L
  370.     }
  371.     MPPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE MPPCompletion(thePBptr: MPPPBPtr); }
  372.     {
  373.         ATPCompletionProcPtr uses register based parameters on the 68k and cannot
  374.         be written in or called from a high-level language without the help of
  375.         mixed mode or assembly glue.
  376.  
  377.         In:
  378.          => thePBptr        A0.L
  379.     }
  380.     ATPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE ATPCompletion(thePBptr: ATPPBPtr); }
  381.     {
  382.         XPPCompletionProcPtr uses register based parameters on the 68k and cannot
  383.         be written in or called from a high-level language without the help of
  384.         mixed mode or assembly glue.
  385.  
  386.         In:
  387.          => thePBptr        A0.L
  388.     }
  389.     XPPCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE XPPCompletion(thePBptr: XPPParmBlkPtr); }
  390.     {
  391.         AttnRoutineProcPtr uses register based parameters on the 68k and cannot
  392.         be written in or called from a high-level language without the help of
  393.         mixed mode or assembly glue.
  394.  
  395.         In:
  396.          => sessRefnum      D0.W
  397.          => attnBytes       D1.W
  398.     }
  399.     AttnRoutineProcPtr = Register68kProcPtr;  { register PROCEDURE AttnRoutine(sessRefnum: INTEGER; attnBytes: INTEGER); }
  400.     MPPCompletionUPP = UniversalProcPtr;
  401.     ATPCompletionUPP = UniversalProcPtr;
  402.     XPPCompletionUPP = UniversalProcPtr;
  403.     AttnRoutineUPP = UniversalProcPtr;
  404.  
  405.     WDSElement = RECORD
  406.         entryLength:            INTEGER;
  407.         entryPtr:                Ptr;
  408.     END;
  409.  
  410.     NTElement = RECORD
  411.         nteAddress:                AddrBlock;                                {network address of entity}
  412.         filler:                    SInt8;
  413.         entityData:                PACKED ARRAY [0..98] OF SInt8;            {Object, Type & Zone}
  414.     END;
  415.  
  416.     NamesTableEntry = RECORD
  417.         qNext:                    Ptr;                                    {ptr to next NTE}
  418.         nt:                        NTElement;
  419.     END;
  420.  
  421.     MPPProtocolHandlerProcPtr = ProcPtr;  { FUNCTION MPPProtocolHandler(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  422.     DDPSocketListenerProcPtr = ProcPtr;  { FUNCTION DDPSocketListener(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  423.     MPPProtocolHandlerUPP = UniversalProcPtr;
  424.     DDPSocketListenerUPP = UniversalProcPtr;
  425.  
  426.     MPPParamBlock = PACKED RECORD
  427.         qLink:                    ^QElem;
  428.         qType:                    INTEGER;
  429.         ioTrap:                    INTEGER;
  430.         ioCmdAddr:                Ptr;
  431.         ioCompletion:            ATPCompletionUPP;
  432.         ioResult:                OSErr;
  433.         userData:                LONGINT;
  434.         reqTID:                    INTEGER;
  435.         ioRefNum:                INTEGER;
  436.         csCode:                    INTEGER;
  437.         CASE INTEGER OF
  438.         0: (
  439.             filler0:                    INTEGER;
  440.             wdsPointer:                    Ptr;
  441.            );
  442.         1: (
  443.             protType:                    UInt8;
  444.             filler:                        UInt8;
  445.             handler:                    MPPProtocolHandlerUPP;
  446.            );
  447.         2: (
  448.             socket:                        UInt8;
  449.             checksumFlag:                UInt8;
  450.             listener:                    DDPSocketListenerUPP;
  451.            );
  452.         3: (
  453.             interval:                    SInt8; (* UInt8 *)                    {retry interval }
  454.             count:                        SInt8; (* UInt8 *)                    {retry count }
  455.             nbpPtrs:                    Ptr;
  456.             CASE INTEGER OF
  457.             0: (
  458.                 verifyFlag:                        SInt8; (* UInt8 *)
  459.                 filler3:                        SInt8; (* UInt8 *)
  460.                );
  461.             1: (
  462.                 retBuffPtr:                        Ptr;
  463.                 retBuffSize:                    INTEGER;
  464.                 maxToGet:                        INTEGER;
  465.                 numGotten:                        INTEGER;
  466.                );
  467.             2: (
  468.                 confirmAddr:                    AddrBlock;
  469.                 newSocket:                        SInt8; (* UInt8 *)
  470.                 filler4:                        SInt8; (* UInt8 *)
  471.                );
  472.            );
  473.         4: (
  474.             newSelfFlag:                UInt8;                                {self-send toggle flag }
  475.             oldSelfFlag:                UInt8;                                {previous self-send state }
  476.            );
  477.         5: (
  478.             nKillQEl:                    Ptr;                                {ptr to i/o queue element to cancel }
  479.            );
  480.         6: (
  481.             version:                    INTEGER;
  482.             varsPtr:                    Ptr;
  483.             DCEPtr:                        Ptr;
  484.             portID:                        INTEGER;
  485.             configuration:                LONGINT;
  486.             selfSend:                    INTEGER;
  487.             netLo:                        INTEGER;
  488.             netHi:                        INTEGER;
  489.             ourAdd:                        LONGINT;
  490.             routerAddr:                    LONGINT;
  491.             numOfPHs:                    INTEGER;
  492.             numOfSkts:                    INTEGER;
  493.             numNBPEs:                    INTEGER;
  494.             nTQueue:                    Ptr;
  495.             LAlength:                    INTEGER;
  496.             linkAddr:                    Ptr;
  497.             zoneName:                    Ptr;
  498.            );
  499.         7: (
  500.             appName:                    Ptr;                                {pointer to application name in buffer}
  501.            );
  502.     END;
  503.  
  504.     XPPParamBlock = PACKED RECORD
  505.         qLink:                    ^QElem;
  506.         qType:                    INTEGER;
  507.         ioTrap:                    INTEGER;
  508.         ioCmdAddr:                Ptr;
  509.         ioCompletion:            XPPCompletionUPP;
  510.         ioResult:                OSErr;
  511.         cmdResult:                LONGINT;
  512.         ioVRefNum:                INTEGER;
  513.         ioRefNum:                INTEGER;
  514.         csCode:                    INTEGER;
  515.         CASE INTEGER OF
  516.         0: (
  517.             abortSCBPtr:                Ptr;                                { SCB pointer for AbortOS}
  518.            );
  519.         1: (
  520.             aspMaxCmdSize:                INTEGER;
  521.             aspQuantumSize:                INTEGER;
  522.             numSesss:                    INTEGER;
  523.            );
  524.         2: (
  525.             sessRefnum:                    INTEGER;
  526.             aspTimeout:                    SInt8; (* UInt8 *)
  527.             aspRetry:                    SInt8; (* UInt8 *)
  528.             CASE INTEGER OF
  529.             0: (
  530.                 serverAddr:                        AddrBlock;
  531.                 scbPointer:                        Ptr;
  532.                 attnRoutine:                    AttnRoutineUPP;
  533.                );
  534.             1: (
  535.                 cbSize:                            INTEGER;
  536.                 cbPtr:                            Ptr;
  537.                 rbSize:                            INTEGER;
  538.                 rbPtr:                            Ptr;
  539.                 CASE INTEGER OF
  540.                 0: (
  541.                     afpAddrBlock:                        AddrBlock;
  542.                     afpSCBPtr:                            Ptr;
  543.                     afpAttnRoutine:                        Ptr;
  544.                    );
  545.                 1: (
  546.                     wdSize:                                INTEGER;
  547.                     wdPtr:                                Ptr;
  548.                     ccbStart:                            ARRAY [0..295] OF SInt8; (* UInt8 *)
  549.                    );
  550.                );
  551.            );
  552.         3: (
  553.             xppSubCode:                    INTEGER;
  554.             xppTimeout:                    UInt8;
  555.             xppRetry:                    UInt8;
  556.             filler1:                    INTEGER;
  557.             zipBuffPtr:                    Ptr;
  558.             zipNumZones:                INTEGER;
  559.             zipLastFlag:                UInt8;
  560.             filler2:                    UInt8;
  561.             zipInfoField:                PACKED ARRAY [1..70] OF UInt8;
  562.            );
  563.     END;
  564.  
  565.     ATPParamBlock = PACKED RECORD
  566.         qLink:                    ^QElem;
  567.         qType:                    INTEGER;
  568.         ioTrap:                    INTEGER;
  569.         ioCmdAddr:                Ptr;
  570.         ioCompletion:            ATPCompletionUPP;
  571.         ioResult:                OSErr;
  572.         userData:                LONGINT;
  573.         reqTID:                    INTEGER;
  574.         ioRefNum:                INTEGER;
  575.         csCode:                    INTEGER;
  576.         atpSocket:                UInt8;
  577.         atpFlags:                UInt8;
  578.         addrBlock:                AddrBlock;
  579.         reqLength:                INTEGER;
  580.         reqPointer:                Ptr;
  581.         bdsPointer:                Ptr;
  582.         CASE INTEGER OF
  583.         0: (
  584.             numOfBuffs:                    UInt8;
  585.             timeOutVal:                    UInt8;
  586.             numOfResps:                    UInt8;
  587.             retryCount:                    UInt8;
  588.             intBuff:                    INTEGER;
  589.             TRelTime:                    UInt8;
  590.            );
  591.         1: (
  592.             filler:                        UInt8;
  593.             bdsSize:                    UInt8;
  594.             transID:                    INTEGER;
  595.            );
  596.         2: (
  597.             bitMap:                        UInt8;
  598.             filler2:                    UInt8;
  599.            );
  600.         3: (
  601.             rspNum:                        UInt8;
  602.             filler3:                    UInt8;
  603.            );
  604.         4: (
  605.             aKillQEl:                    Ptr;
  606.            );
  607.     END;
  608.  
  609.  
  610. CONST
  611.     uppATalkTransitionEventProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  612.     uppMPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  613.     uppATPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  614.     uppXPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  615.     uppAttnRoutineProcInfo = $00061002; { Register PROCEDURE (2 bytes in D0, 2 bytes in D1); }
  616.     uppMPPProtocolHandlerProcInfo = $0000007F; { SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ) }
  617.     uppDDPSocketListenerProcInfo = $0000008F; { SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener ) }
  618.  
  619. FUNCTION NewATalkTransitionEventProc(userRoutine: ATalkTransitionEventProcPtr): ATalkTransitionEventUPP;
  620.     {$IFC NOT GENERATINGCFM }
  621.     INLINE $2E9F;
  622.     {$ENDC}
  623.  
  624. FUNCTION NewMPPCompletionProc(userRoutine: MPPCompletionProcPtr): MPPCompletionUPP;
  625.     {$IFC NOT GENERATINGCFM }
  626.     INLINE $2E9F;
  627.     {$ENDC}
  628.  
  629. FUNCTION NewATPCompletionProc(userRoutine: ATPCompletionProcPtr): ATPCompletionUPP;
  630.     {$IFC NOT GENERATINGCFM }
  631.     INLINE $2E9F;
  632.     {$ENDC}
  633.  
  634. FUNCTION NewXPPCompletionProc(userRoutine: XPPCompletionProcPtr): XPPCompletionUPP;
  635.     {$IFC NOT GENERATINGCFM }
  636.     INLINE $2E9F;
  637.     {$ENDC}
  638.  
  639. FUNCTION NewAttnRoutineProc(userRoutine: AttnRoutineProcPtr): AttnRoutineUPP;
  640.     {$IFC NOT GENERATINGCFM }
  641.     INLINE $2E9F;
  642.     {$ENDC}
  643.  
  644. FUNCTION NewMPPProtocolHandlerProc(userRoutine: MPPProtocolHandlerProcPtr): MPPProtocolHandlerUPP;
  645.     {$IFC NOT GENERATINGCFM }
  646.     INLINE $2E9F;
  647.     {$ENDC}
  648.  
  649. FUNCTION NewDDPSocketListenerProc(userRoutine: DDPSocketListenerProcPtr): DDPSocketListenerUPP;
  650.     {$IFC NOT GENERATINGCFM }
  651.     INLINE $2E9F;
  652.     {$ENDC}
  653.  
  654. FUNCTION CallATalkTransitionEventProc(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr; userRoutine: ATalkTransitionEventUPP): LONGINT;
  655.     {$IFC NOT GENERATINGCFM}
  656.     INLINE $205F, $4E90;
  657.     {$ENDC}
  658.  
  659. PROCEDURE CallMPPCompletionProc(thePBptr: MPPPBPtr; userRoutine: MPPCompletionUPP);
  660.     {$IFC NOT GENERATINGCFM}
  661.     {To be implemented:  Glue to move parameters into registers.}
  662.     {$ENDC}
  663.  
  664. PROCEDURE CallATPCompletionProc(thePBptr: ATPPBPtr; userRoutine: ATPCompletionUPP);
  665.     {$IFC NOT GENERATINGCFM}
  666.     {To be implemented:  Glue to move parameters into registers.}
  667.     {$ENDC}
  668.  
  669. PROCEDURE CallXPPCompletionProc(thePBptr: XPPParmBlkPtr; userRoutine: XPPCompletionUPP);
  670.     {$IFC NOT GENERATINGCFM}
  671.     {To be implemented:  Glue to move parameters into registers.}
  672.     {$ENDC}
  673.  
  674. PROCEDURE CallAttnRoutineProc(sessRefnum: INTEGER; attnBytes: INTEGER; userRoutine: AttnRoutineUPP);
  675.     {$IFC NOT GENERATINGCFM}
  676.     {To be implemented:  Glue to move parameters into registers.}
  677.     {$ENDC}
  678.  
  679. FUNCTION CallMPPProtocolHandlerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER; userRoutine: MPPProtocolHandlerUPP): BOOLEAN;
  680.     {$IFC NOT GENERATINGCFM}
  681.     {To be implemented:  Glue to move parameters according to special case conventions.}
  682.     {$ENDC}
  683.  
  684. FUNCTION CallDDPSocketListenerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER; userRoutine: DDPSocketListenerUPP): BOOLEAN;
  685.     {$IFC NOT GENERATINGCFM}
  686.     {To be implemented:  Glue to move parameters according to special case conventions.}
  687.     {$ENDC}
  688.  
  689. FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr;
  690. FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  691. FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  692. FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  693. FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  694. FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  695. FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  696. FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  697. FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  698. FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  699. FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  700. FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  701. FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  702. FUNCTION PAttachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  703. FUNCTION PDetachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  704. FUNCTION PWriteLAP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  705. FUNCTION POpenSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  706. FUNCTION PCloseSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  707. FUNCTION PWriteDDP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  708. FUNCTION PRegisterName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  709. FUNCTION PLookupName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  710. FUNCTION PConfirmName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  711. FUNCTION PRemoveName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  712. FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  713. FUNCTION PKillNBP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  714. FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  715. FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  716. FUNCTION POpenATPSkt(thePBptr: ATPPBPtr; async: BOOLEAN): OSErr;
  717. FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  718. FUNCTION PSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  719. FUNCTION PGetRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  720. FUNCTION PSendResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  721. FUNCTION PAddResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  722. FUNCTION PRelTCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  723. FUNCTION PRelRspCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  724. FUNCTION PNSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  725. FUNCTION PKillSendReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  726. FUNCTION PKillGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  727. FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  728. PROCEDURE BuildLAPwds(wdsPtr: Ptr; dataPtr: Ptr; destHost: INTEGER; prototype: INTEGER; frameLen: INTEGER);
  729. PROCEDURE BuildDDPwds(wdsPtr: Ptr; headerPtr: Ptr; dataPtr: Ptr; netAddr: AddrBlock; ddpType: INTEGER; dataLen: INTEGER);
  730. PROCEDURE NBPSetEntity(buffer: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param);
  731. PROCEDURE NBPSetNTE(ntePtr: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param; socket: INTEGER);
  732. FUNCTION GetBridgeAddress: INTEGER;
  733. FUNCTION BuildBDS(buffPtr: Ptr; bdsPtr: Ptr; buffSize: INTEGER): INTEGER;
  734. FUNCTION MPPOpen: OSErr;
  735. FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr;
  736. FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr;
  737. FUNCTION ATPLoad: OSErr;
  738. FUNCTION ATPUnload: OSErr;
  739. FUNCTION NBPExtract(theBuffer: Ptr; numInBuf: INTEGER; whichOne: INTEGER; VAR abEntity: EntityName; VAR address: AddrBlock): OSErr;
  740. FUNCTION GetNodeAddress(VAR myNode: INTEGER; VAR myNet: INTEGER): OSErr;
  741. FUNCTION IsMPPOpen: BOOLEAN;
  742. FUNCTION IsATPOpen: BOOLEAN;
  743. PROCEDURE ATEvent(event: LONGINT; infoPtr: Ptr);
  744. FUNCTION ATPreFlightEvent(event: LONGINT; cancel: LONGINT; infoPtr: Ptr): OSErr;
  745. {
  746.     The following routines are obsolete and will not be supported on
  747.     PowerPC. Equivalent functionality is provided by the routines
  748.     above.
  749. }
  750. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  751. FUNCTION MPPClose: OSErr;
  752. FUNCTION LAPOpenProtocol(theLAPType: ByteParameter; protoPtr: Ptr): OSErr;
  753. FUNCTION LAPCloseProtocol(theLAPType: ByteParameter): OSErr;
  754. FUNCTION LAPWrite(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  755. FUNCTION LAPRead(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  756. FUNCTION LAPRdCancel(abRecord: ATLAPRecHandle): OSErr;
  757. FUNCTION DDPOpenSocket(VAR theSocket: INTEGER; sktListener: Ptr): OSErr;
  758. FUNCTION DDPCloseSocket(theSocket: INTEGER): OSErr;
  759. FUNCTION DDPRead(abRecord: ATDDPRecHandle; retCksumErrs: BOOLEAN; async: BOOLEAN): OSErr;
  760. FUNCTION DDPWrite(abRecord: ATDDPRecHandle; doChecksum: BOOLEAN; async: BOOLEAN): OSErr;
  761. FUNCTION DDPRdCancel(abRecord: ATDDPRecHandle): OSErr;
  762. FUNCTION ATPOpenSocket(addrRcvd: AddrBlock; VAR atpSocket: INTEGER): OSErr;
  763. FUNCTION ATPCloseSocket(atpSocket: INTEGER): OSErr;
  764. FUNCTION ATPSndRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  765. FUNCTION ATPRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  766. FUNCTION ATPReqCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  767. FUNCTION ATPGetRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  768. FUNCTION ATPSndRsp(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  769. FUNCTION ATPAddRsp(abRecord: ATATPRecHandle): OSErr;
  770. FUNCTION ATPResponse(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  771. FUNCTION ATPRspCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  772. FUNCTION NBPRegister(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  773. FUNCTION NBPLookup(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  774. FUNCTION NBPConfirm(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  775. FUNCTION NBPRemove(abEntity: EntityPtr): OSErr;
  776. FUNCTION NBPLoad: OSErr;
  777. FUNCTION NBPUnload: OSErr;
  778. {$ENDC}
  779.  
  780. {$ALIGN RESET}
  781. {$POP}
  782.  
  783. {$SETC UsingIncludes := AppleTalkIncludes}
  784.  
  785. {$ENDC} {__APPLETALK__}
  786.  
  787. {$IFC NOT UsingIncludes}
  788.  END.
  789. {$ENDC}
  790.